const express = require('express');
const router = express.Router();

router.get('/forCurrentUser', (req, res) => {
    const content = [];
    for(let i = 0; i < 40; i++) content.push({
        id: `${i + 1}`,
        code: 'string',
        marketingActivityCode: 'string',
        dealerCode: 'string',
        brandCode: 'string',
        theme: 'string',
        amount: 1,
        totalFee: 1,
        status: 1,
        currency: 1,
        statDate: '2020-05-20T03:12:29.465Z',
        endDate: '2020-05-20T03:12:29.465Z',
        rowVersion: 'string',
        options: [
            'update',
            'submit',
            'abandon',
            'confirm',
            'upInvoice',
            'invoiceConfirm',
            'writeOff',
        ]
    });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 41,
        }
    });
});

router.get('/:id', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                id: '1',
                code: 'string',
                marketingActivityId: 'string',
                marketingActivityCode: 'string',
                dealerId: 'string',
                dealerCode: 'string',
                dealerName: 'string',
                brandId: 'string',
                brandCode: 'string',
                brandName: 'string',
                theme: 'string',
                currency: 1,
                statDate: '2020-05-20T03:17:53.173Z',
                endDate: '2020-05-20T03:17:53.173Z',
                mainItem: [0, 1],
                mainItemName: 'string',
                mainItemRemark: 'string',
                actualMainItem: [0, 1],
                actualMainItemName: ['string'],
                actualMainItemRemark: 'string',
                scope: 'string',
                customerQTY: 1,
                amount: 1,
                actualCustomerQTY: 1,
                totalFee: 1,
                actualSituation: 'string',
                opinion: 'string',
                confirmComment: 'string',
                uploadComment: 'string',
                invoiceComment: 'string',
                writeOffComment: 'string',
                rowVersion: 'string',
                options: [
                    'update',
                    'submit',
                    'abandon',
                    'confirm',
                    'upInvoice',
                    'invoiceConfirm',
                    'writeOff',
                ],
                planItemDetails: [
                    {
                        marketingActivityItemId: '1',
                        num: 'string',
                        marketingActivityItemCategoryL1Id: 'string',
                        marketingActivityItemCategoryL1Name: 'string',
                        marketingActivityItemCategoryL2Id: 'string',
                        marketingActivityItemCategoryL2Name: 'string',
                        item: 'string',
                        amount: 1,
                        address: 'string',
                        posts: 1,
                        reading: 1,
                        traffic: 1,
                        likes: 1,
                        commentVolume: 1,
                        forwardingVolume: 1,
                        remark: 'string'
                    }
                ],
                actualItemDetails: [
                    {
                        marketingActivityItemId: '1',
                        num: 'string',
                        marketingActivityItemCategoryL1Id: 'string',
                        marketingActivityItemCategoryL1Name: 'string',
                        marketingActivityItemCategoryL2Id: 'string',
                        marketingActivityItemCategoryL2Name: 'string',
                        item: 'string',
                        amount: 1,
                        address: 'string',
                        posts: 1,
                        reading: 1,
                        traffic: 1,
                        likes: 1,
                        commentVolume: 1,
                        forwardingVolume: 1,
                        remark: 'string'
                    }
                ],
                attachmentPresentations: [
                    {
                        fileId: '001',
                        fileName: 'fileName001'
                    }
                ],
                attachmentInvoices: [
                    {
                        fileId: '001',
                        fileName: 'fileName001'
                    }
                ],
            }
        }
    );
});
router.put('/:id', (req, res) => {
    res.json({
        message: '编辑成功'
    });
});
router.post('/', (req, res) => {
    res.json({
        message: '新增成功'
    });
});
router.put('/:id/abandon', (req, res) => {
    res.json({
        message: '作废成功'
    });
});
router.put('/:id/confirm', (req, res) => {
    res.json({
        message: '确认'
    });
});
router.put('/:id/upInvoice', (req, res) => {
    res.json({
        message: '上传发票'
    });
});
router.put('/:id/invoiceConfirm', (req, res) => {
    res.json({
        message: '发票确认'
    });
});
router.put('/:id/writeOff', (req, res) => {
    res.json({
        message: '核销'
    });
});
router.get('/export/forCurrentUser', (req, res) => {
    res.json({
        message: '导出成功'
    });
});
module.exports = router;
